home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 14 / 014.d81 / finding all < prev    next >
Text File  |  2022-08-26  |  718b  |  46 lines

  1.  
  2.          FINDING ALL SOLUTIONS
  3.  
  4.  Given the linear diophantine equation
  5.  
  6.             AX + BY = N,
  7.  
  8. and assume that there exists one
  9.  
  10. solution X',Y'.
  11.  
  12.  
  13.  
  14.           A                B
  15. Let A' = ----   and  B' = ---- .
  16.         (A,B)             (A,B)
  17.  
  18. Then ALL solutions can be written in
  19.  
  20. the form
  21.  
  22.     X = X' + KB'    Y = Y' - KA'
  23.  
  24. where K ranges over all integers.
  25.  
  26. This means that if we can find one
  27.  
  28. solution to the linear diophantine
  29.  
  30. equation, then there are infinitely
  31.  
  32. many solutions, and they can all be
  33.  
  34. generated from the one found first.
  35.  
  36. Hit "\" if you want to run the program
  37. \oad"diophantine",8
  38. which solves a diophantine equation
  39.  
  40. now.
  41.  
  42.                 Al Vekovius
  43.  
  44.  
  45. ---------< end of article >-----------
  46.